<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统登录</title>
<link href="css/index.css" rel="stylesheet" />
<script src="js/jquery-1.9.1.js"></script>
<!--[if IE 6]>
<script src="../javascript/DD_belatedPNG_0.0.8a.js"></script>
<script>
DD_belatedPNG.fix('.wrap_top');   9cdcf8
</script>
<![endif]-->
<script>
	window.onload = function() {
		var oDiv = document.getElementById('login_box');
		oDiv.style.left = (veiwWidth() - oDiv.offsetWidth) / 2 + 'px';
		oDiv.style.top = (veiwHeight() - oDiv.offsetHeight) / 2 + 'px';
		function veiwWidth() {
			return document.documentElement.clientWidth;
		}

		function veiwHeight() {
			return document.documentElement.clientHeight;
		}
	};

	function logins() {
		 if ($('#name').val() == "") {
			$('#login_red').html("请输入用户名！");
			return false;
		}
		if ($('#password').val() == "") {
			$('#login_red').html("请输入密码！");
			return false;
		}
		if ($('#verifyCode').val() == "") {
			$('#login_red').html("请输入验证码！");
			return false;
		} 

		$.ajax({
			dataType : "text",
			type : "POST",
			url : "admin/r_admin_ajax.action",
			data : "name=" + $('#name').val() + "&password="
					+ $('#password').val() + "&verifyCode="
					+ $('#verifyCode').val(),
			success : function(msg) {
				if (msg == '1') {
					document.admin_login.submit();
				} else if (msg == '2') {
					$('#login_red').html("验证码有误，请重新输入。");
				} else if (msg == '3') {
					$('#login_red').html("该账户已冻结！");
				} else {
					$('#login_red').html("您输入的用户名或密码有误！");
				}
			}
		});

	}

	function login_reset() {
		$('#login_red').html("");
		$('#admin_login')[0].reset();
	}

	function reloadverifyCode() {
		var timenow = new Date().getTime();
		document.getElementById("safecode").src = "verifyCode.do?type=login&d="
				+ timenow;
	}
</script>
</head>
<body>
	<div id="login_box">
		<div class="login_title">凤凰知音汇业务管理系统</div>
		<div class="info_box">
			<form action="#" method="post" name="admin_login"
				id="admin_login">
				<p class="login_tip" id="login_red"></p>
				<div style="margin-top:10px;">
					用户名&emsp; <input type="text" name="name" id="name"
						class="comm_text" value="" />
				</div>

				<div class="login_password">
					密&emsp;码&emsp; <input type="password" name="password" id="password"
						class="comm_text" value="" />
				</div>
				<div class="login_yzm clear">
					<div class="tip_left">
						<span>验证码&emsp;&nbsp;</span>
					</div>
					<div class="tip_input">
						<input id="verifyCode" name="verifyCode" type="text"
							class="comm_yzm" />
					</div>
					<div class="tip_mid">
						<span> <img alt="验证码" id="safecode"
							src="verifyCode.do?type=login" onclick="reloadverifyCode();"
							width="60" height="30" style="cursor:pointer" /> </span>
					</div>
					<div class="tip_right">
						<a href="javascript:reloadverifyCode();" class="tip_text">看不清，换一张？</a>
					</div>
				</div>

				<div class="login_button" style="margin-bottom:0;">
					<a href="#" onclick="logins();" class="btn_login" style="margin-right:0;">确 认</a>&emsp;&emsp;&emsp;&emsp; <a
						href="#" onclick="login_reset();" class="btn_reset">重 置</a>
				</div>
			</form>
		</div>
	</div>
</body>
</html>